The present invention relates to a method for automatic address assignment in a bus system having a plurality of communications subscribers or a bus system having a plurality of communications subscribers which are suitable for automatic address assignment, and to the communications subscribers which can be used in the bus system and/or within the framework of the method.
The communications system here is a bus system in which no means for address assignment, for example electronic or mechanical switches, no means for signal delay, etc., are provided for the communications subscribers themselves.
A method for automatic address assignment in which the actual communications subscribers which are connected to the bus each have means for address allocation is conventional. For example, in the automation device S7-300 from SIEMENS Aktiengesellschaft, communications subscribers which are connected to the bus have, for example, electrically active components with which it is possible to bring about a situation for the respective communications subscriber in which a signal sequence which is transmitted by a superordinate communications subscriber is represented at the respective communications subscriber in a different way than in the case of further communications subscribers which may be present on the bus. In this case, it is ensured, for example, that the signal sequence which is transmitted by the superordinate communications subscriber first reaches only as far as the first communications subscriber; this communications subscriber modifies the received signal sequence, derives its own address from it and passes on the modified signal sequence to the next communications subscriber only when the modification of the signal sequence and the derivation of the address have been terminated. The second communications subscriber on the bus adopts the same procedure.
A method for automatic address assignment is also known for a superordinate communications subscriber which has, in each case, a so-called port for communicative connection with other communications subscribers, it being possible for each of the communications subscribers to be connected to in each case one of these ports of the superordinate communications subscriber, the address of the respective communications subscriber being defined implicitly by means of the connection to the respective port. Such star-shaped connections are also referred to as point-to-point connections and can be used, for example, when connecting peripheral equipment to a personal computer.
An automatic address allocation is not currently possible in certain types of communications systems, in particular bus systems, in particular serial bus systems, in which no means for address assignment are provided for the individual communications subscribers.
In addition, owing to the topology, an address, even a default address, may occur only once in a bus system because otherwise it is impossible for the communications subscribers to be identified unambiguously, and thus unambiguous data transmission is impossible.
Furthermore, in the conventional bus systems, it is not possible for a plurality of communications subscribers to be incorporated simultaneously into the bus system. New communications subscribers which are to be added can be recognized in most cases as new communications subscribers by reference to a predefinable default address so that if a plurality of communications subscribers with identical default addresses are added simultaneously, ambiguity occurs which makes simultaneous automatic incorporation of a plurality of communications subscribers impossible. A similar problem arises also when defective communications subscribers are exchanged if a communications subscriber with an address which has already been assigned is connected to the communications system when the exchange occurs.
An object of the present invention is to provide a method for automatic address assignment in a bus system having a plurality of communications subscribers and/or a bus system having a plurality of communications subscribers which are suitable for an automatic address assignment and/or the communications subscribers which can be used in the bus system and/or within the scope of the method, with which method, bus system and/or communications subscribers the abovementioned problems are avoided.
This object is achieved by providing a method for automatic address assignment in a communications system having a plurality of communications subscribers, at least one of which, referred to below as master, performs a superordinate function. The master transmits for the address assignment, a signal sequence, in the following referred to as preamble. The signal sequence is received by the remaining communications subscribers, referred to below as slaves. Each slave which has not yet been allocated an address immediately transmits a signal sequence in response to the preamble, that slave which is chronologically the last to receive the preamble detects, determined from the fact that no further actions take place in the communications system within a predefined time after the signal sequence which was transmitted by it, that, as viewed from the master, there are no further slaves without address allocation present in the communications system spatially after it subsequently switches into an operating mode B which permits an address-assigning telegram from the master to be received. The address-assigning telegram is used by this slave for address assignment. The further slaves without address allocation, which detect actions in the communications system after their own response, waiting again for the preamble of the master.
This object is also achieved by providing a communications system having a plurality of communications subscribers which are suitable for an automatic address assignment. At least one of the subscribers referred to below as master, performs a superordinate function. The master being capable of transmitting a signal sequence for address assignment, referred to below as preamble. The remaining communications subscribers, referred to below as slaves, which have not yet been allocated an address are capable of immediately transmitting a signal sequence in response to the preamble. Each slave is capable of monitoring the communications system after the reception of the preamble. At least one signal sequence which is transmitted by a slave and is intended for the other slaves is capable of being evaluated as an action in the communications system, the absence of the action in the communications system during a predefinable time period being capable of being evaluated by the respective slave to the effect that there are no further slaves without address allocation spatially after it in the communications system, with the result that the respective slave can be switched into an operating mode which permits an address-assigning telegram from the master to be received, with which address-assigning telegram the address assignment for this slave can be effected.
For the communications subscribers, the object is achieved, on the one hand, by means of a super ordinate communications subscriber, referred to below as master, which is suitable for automatic address assignment in a communications system having other communications subscribers, referred to below as slaves, the master at least being suitable
for transmitting a signal sequence in order to initiate the address assignment, referred to below as preamble,
for receiving a response signal sequence, which can be transmitted via one of the slaves in reaction to the preamble, and
for transmitting an address-assigning telegram to the transmitter of the response signal sequence
and, on the other hand, by means of a communications subscriber, referred to below as slave, which is provided for use in a communications system with automatic address assignment, which can be effected by a superordinate communications subscriber, referred to below as master, in which case said master
can be operated in a configuration mode,
in which it is suitable for immediately transmitting a signal sequence in response to a preamble which can be transmitted by the master, and for monitoring the communications system after the reception of the preamble,
at least one response signal sequence which is transmitted by another slave and is intended for the slave being capable of being evaluated as an action in the communications system, and the absence of the action in the communications system during a predefinable time period being capable of being evaluated by the slave to the effect that, as viewed from the master, there are no further slaves without address allocation spatially after it in the communications system, and the slave can subsequently be switched into an operating mode,
and can be operated in the reception mode which at least permits an address-assigning telegram from the master to be received, with which address-assigning telegram the address assignment for the slave can be effected.
If the number of slaves which have not yet been assigned an address is detected, or can be detected, by reference to the number of response signal sequences transmitted by the slaves, a situation in which the method for automatic address assignment is carried out precisely the number of times necessary for all the slaves to be allocated an unambiguous address can be brought about particularly easy.
If the master transmits a preamble again after a slave has been assigned an address, if it is clear that slaves which have not yet been allocated an address are still present in the communications system, it is ensured that each slave which has not yet been allocated an address is allocated an address.
If the master transmits a preamble again at predefinable times or in a predefinable time pattern while the communications system is operating, it is ensured that new communications subscribers which are added are allocated an address even while the communications system is operating.
If the addresses of the slaves are assigned in an ascending or descending sequence corresponding to the distance from the master, each address of a slave implicitly contains an information item which relates to a relative position and which can be evaluated, for example, within the scope of a fault locating operation. If a slave with the address X can be accessed and, on the other hand, the slave with the address X+1 can no longer be accessed, it is, for example, clear that the communications system, for example the bus line, between the slave with the address X and the slave with the address X+1 must be faulty, damaged or broken.
If it is possible to generate a mapping of the topology of the slaves connected to the bus by reference to the addresses of the individual slaves, this information can be made available, for example, to a planning and design tool so that a geographical process map can be generated if the communications system is used, for example, within the scope of an automation project for controlling and/or monitoring a technical process.